package com.back.demo.mapper;

import com.back.demo.common.Permission;
import com.back.demo.common.Role;
import com.back.demo.common.User;
import com.back.demo.mapper.myDO.basicDO.ClassDO;
import com.back.demo.mapper.myDO.basicDO.MajorDO;
import com.back.demo.mapper.myDO.basicDO.MentorDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

//import java.util.List;

@Mapper
@Repository
public interface BasicMapper {

    ArrayList<Role> selectRoleByUserId(@Param("userId") Integer userId);

    ArrayList<Integer> selectRoleIdByUsername(@Param("username") String username);

    User selectUserByUsername(@Param("username") String username);

    ArrayList<Permission> selectPermissionByUsername(@Param("username") String username);

    void changePassword(@Param("username") String username, @Param("newPassword") String newPassword);

    Integer getUserId(@Param("username") String username);

    Integer getRole(@Param("userId") Integer userId);

    String selectStuName(@Param("userId") Integer userId);

    String selectJudgeName(@Param("userId") Integer userId);

    String selectAdminName(@Param("userId") Integer userId);

    ArrayList<MajorDO> selectMajor();

    MajorDO selectMajorByMajorId(Integer majorId);

    MajorDO selectMajorByMajorCode(String majorCode);

    ArrayList<ClassDO> selectClass();

    ClassDO selectClassByClassId(Integer classId);

    ArrayList<MentorDO> selectMentor();

    MentorDO selectMentorByMentorId(Integer mentorId);

    MentorDO selectMentorByJobId(String jobId);
}